cmake_minimum_required(VERSION 3.15)
project(QuadCerebellum)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_BUILD_TYPE "Release")
set(CMAKE_CXX_FLAGS "-O3")
find_package(Eigen3)
find_package(lcm)
#find_package(qpOASES)
include_directories(
        Control
        Drive
        Maintain
        Plan
        Sense
        Model
        ThirdParty
        LCM
        ThirdParty/rosbridgecpp
        ThirdParty/qpOASES/include
        ${EIGEN3_INCLUDE_DIR}
        ${LCM_INCLUDE_DIR}
#        ${QPOASES_INCLUDE_DIR}
)
add_subdirectory(
        ThirdParty/rosbridgecpp rosbridgecpp
)
#link_libraries(
#        "/usr/local/lib/libqpOASES.a"
#)
link_directories(
        "/usr/local/lib"
)
add_executable(
        QuadCerebellum
        Maintain/main.cpp
        Drive/InertialSenserDriver.h
        Sense/InertialInfo.h Drive/GazeboInertialSenserDriver.cpp Drive/GazeboInertialSenserDriver.h Drive/GazeboMotorsDriver.cpp Drive/GazeboMotorsDriver.h
        Maintain/CentralMaintainer.cpp Maintain/CentralMaintainer.h Maintain/EnumStructs.h Maintain/main.h Drive/MotorsStructs.h Maintain/PeriodicTask.cpp Maintain/PeriodicTask.h Maintain/PeriodicTaskManager.cpp Maintain/PeriodicTaskManager.h Control/LegsController.cpp Control/LegsController.h Model/QuadrupedSpecifiction.h Model/QuadrupedKinematics.cpp Model/QuadrupedKinematics.h Model/QuadrupedState.cpp Model/QuadrupedState.h Plan/DefaultGaitPlanner.cpp Plan/DefaultGaitPlanner.h Plan/DefaultSwingLegPlanner.cpp Plan/DefaultSwingLegPlanner.h Control/ConvexMPController.cpp Control/ConvexMPController.h Maintain/PeriodicFunctionTask.h Maintain/HighFrequencyTasksWrapper.cpp Maintain/HighFrequencyTasksWrapper.h Sense/OrientationEstimator.cpp Sense/OrientationEstimator.h Sense/PositionVelocityEstimator.cpp Sense/PositionVelocityEstimator.h Drive/PyBulletMotorsDriver.cpp Drive/PyBulletMotorsDriver.h Control/LegStructs.h Drive/SensorStructs.h Drive/PyBulletIMUDriver.cpp Drive/PyBulletIMUDriver.h Drive/PyBulletCheaterSensorDriver.cpp Drive/PyBulletCheaterSensorDriver.h Sense/StateEstimator.cpp Sense/StateEstimator.h Sense/StateStructs.h Plan/OffsetDurationGait.cpp Plan/OffsetDurationGait.h Control/SolverMPC.h Control/SolverMPC.cpp Control/ConvexMPCInterface.h Control/ConvexMPCInterface.cpp Control/common_types.h Control/RobotState.cpp Control/RobotState.h)

target_link_libraries(
        QuadCerebellum rosbridgecpp lcm libqpOASES.a
)
